package cn.sxt.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/5/8 9:00
 */
@Data
@TableName(value = "bills")
public class Bills implements Serializable {

    private static final long serialVersionUID = 667710L;

    /**
     * 账单id
     */
    @TableId(value = "id", type = IdType.INPUT)
    private Integer id;

    /**
     * 账单标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 记账时间
     */
    @TableField(value = "bill_time")
    //格式化日期
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date billTime;

    /**
     * 账单类别
     */
    @TableField(value = "type_id")
    private String typeId;

    /**
     * 账单金额
     */
    @TableField(value = "price")
    private Integer price;

    /**
     * 账单说明
     */
    @TableField(value = "remark")
    private String remark;

    // 数据库没有
    @TableField(exist = false)
    private String typeName;
}